﻿Imports System.Security.Cryptography
Imports System.IO
Imports System.Text
Public Class Encriptacion
    Public Function EncriptaSHA(ByVal strcadena As String) As String
        Dim Codificacion As New UTF8Encoding
        Dim data() As Byte = Codificacion.GetBytes(strcadena)
        Dim resultado() As Byte
        Dim sha As New SHA1CryptoServiceProvider()
        resultado = sha.ComputeHash(data)
        Dim sb As New StringBuilder
        For i As Integer = 0 To resultado.Length - 1
            If resultado(i) < 16 Then
                sb.Append("0")
            End If
            sb.Append(resultado(i).ToString("x"))
        Next
        Return sb.ToString().ToUpper
    End Function
End Class
